<?php
$this->headTitle('Thành viên','append');
?>
<div class="dashboard-menu dashboard-admin">
    <span class="back">&nbsp;</span>
    <a href="/admin/user"><h1>Thành viên</h1></a>
    <span class="text"><?php echo $this->roleCheck['roleName'];?></span>
</div>
<div class="row placeholders">
    <div class="col-md-12">
        <div class="widget-big">
            <div class="search-result text-left">
            	<?php
                    if(isset($this->mess)){
                        if($this->flag == 'success')
                            echo '<div class="bg-success">',$this->mess,'</div>';
                        elseif($this->flag == 'alert')
                            echo '<div class="bg-warning">',$this->mess,'</div>';
                        else
                            echo '<div class="bg-danger">',$this->mess,'</div>';
                    }
                    echo $this->form;
                ?>
                <?php  if(isset($this->roleList[0])){ ?>
                	<script type="text/javascript">
            	  		$("form > dl.zend_form > dd#email-element").after('<div id="role"><dt><label class="optional" >Quyền đã có</label></dt></div><div class="clr"></div>');
            		</script>
            
            	    <?php foreach($this->roleList as $role){ ?>
            
            		<script type="text/javascript">
            	  		$("form > dl.zend_form > div#role").append('<dd><input type="hidden" value="<?php echo $role['roleId'] ?>" name="userRole[]"><input text="text" readonly="true" name = "role[]"value="<?php echo $role['roleName']; ?>" />&nbsp;&nbsp;<a class="del glyphicon glyphicon-remove" title="xóa" onclick="del(this);"></a>&nbsp;</dd>');
            
            			function del(obj){
            				$(obj).parent().remove();
            
            			}
            		</script>
               <?php  
                        }
                    }
               ?>
            </div>
        </div>
    </div>
</div>
